<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<fmt:message key="footer_message_5" var="footer_message_5"/>
<fmt:message key="menu_plan_label1" var="menu_plan_label1"/>
<fmt:message key="menu_plan_label2" var="menu_plan_label2"/>
<fmt:message key="menu_plan_label3" var="menu_plan_label3"/>
<fmt:message key="menu_plan_label4" var="menu_plan_label4"/>
<fmt:message key="plan_docex_label3" var="plan_docex_label3"/>
<fmt:message key="plan_docex_label4" var="plan_docex_label4"/>
<fmt:message key="plan_docex_label5" var="plan_docex_label5"/>
<fmt:message key="plan_docex_label6" var="plan_docex_label6"/>
<fmt:message key="plan_docex_label7" var="plan_docex_label7"/>
<fmt:message key="plan_docex_label8" var="plan_docex_label8"/>
<fmt:message key="plan_docex_label9" var="plan_docex_label9"/>
<fmt:message key="plan_docex_label10" var="plan_docex_label10"/>
<fmt:message key="plan_docex_label11" var="plan_docex_label11"/>

<script type="text/javascript">
<!--

window.onload = function addEvent() {
    $('attusernames').attachEvent('onpropertychange',function(o){
        if(o.propertyName!='value')return;  //不是value改变不执行下面的操作
        //.函数处理
        var attuserIds = $('attuserids').value;

        new Ajax.Request('<c:url value="/modules/plan/plan.do?method=ajaxSaveAttentionuser"/>',{method: 'post',postBody:'userids='+attuserIds, onSuccess:function(t){
			if(t.responseText=='true'){
				var els=$('show_attentionUnder_top').childNodes;
				for(var i=els.length-1;i>=0;i--){
					$('show_attentionUnder_top').removeChild(els[i]);
				}
				
				els=$('show_attentionUnder').childNodes;
				for(var i=els.length-1;i>=0;i--){
					$('show_attentionUnder').removeChild(els[i]);
				}
				var uids=attuserIds.split(",");
				var unames=$F('attusernames').split(",");
				if(uids.length>0 && uids[0]!=""){
					var newTr;
					for(var i=0;i<(uids.length<=6?uids.length:6);i++){
						if(i%2==0){
							newTr=document.createElement("tr");
							$('show_attentionUnder_top').appendChild(newTr);
						}
						var newTd=document.createElement("td");
						newTd.setAttribute("align","left");
						newTd.style.width="50%";
						var newAimg = document.createElement("a");
						
						newAimg.href="../../modules/plan/plan.do?method=getLatestPlan&id="+uids[i];
						var newImg=document.createElement("img");
						newImg.src="../../themes/${sessionScope.loginUser.theme}/images/mplan.gif";
						newImg.setAttribute("align","absmiddle");
						newImg.style.border="0px";
						newAimg.appendChild(newImg);
						newTd.appendChild(newAimg);
						newTd.appendChild(document.createTextNode(" "));
						var newA=document.createElement("a");
						newA.className="subMenuLink";
						newA.href="../../modules/plan/plan.do?method=query&t=5&search_userXXid_i_eq="+uids[i];
						newA.appendChild(document.createTextNode(unames[i]));
						newTd.appendChild(newA);
						newTr.appendChild(newTd);
						
					}
					
					if(uids.length>6){
						$('show_attentionUnder_icon').style.display="";
						var newTr;
						for(var i=6;i<uids.length;i++){
							if(i%2==0){
								newTr=document.createElement("tr");
								$('show_attentionUnder').appendChild(newTr);
							}
							var newTd=document.createElement("td");
							newTd.setAttribute("align","left");
							newTd.style.width="50%";
							var newAimg = document.createElement("a");
							
							newAimg.href="../../modules/plan/plan.do?method=getLatestWorklog&id="+uids[i];
							var newImg=document.createElement("img");
							newImg.src="../../themes/${sessionScope.loginUser.theme}/images/mplan.gif";
							newImg.setAttribute("align","absmiddle");
							newImg.style.border="0px";
							newAimg.appendChild(newImg);
							newTd.appendChild(newAimg);
							newTd.appendChild(document.createTextNode(" "));
							var newA=document.createElement("a");
							newA.className="subMenuLink";
							newA.href="../../modules/plan/plan.do?method=query&t=5&search_userXXid_i_eq="+uids[i];
							newA.appendChild(document.createTextNode(unames[i]));
							newTd.appendChild(newA);
							newTr.appendChild(newTd);
							
						}
					}else $('show_attentionUnder_icon').style.display="none";
					
					
				}
				
			}
		}});
    });
}
function openwindow(url){
	openwin(url,100,100,730,450,'yes');
}
//-->
</script>
<form name="queryAdv1" method="post">
<jodd:form bean="request">
</jodd:form>
</form>
<c:if test="${issenior}">
<br/>
<TABLE class=leftColumnModuleHead cellSpacing=0 cellPadding=0 width="100%" border=0 valign="top">
 <TBODY>
  <TR>
    <TH class="menu_title_left" width=48>&nbsp;</TH>
    <TH class="menu_title_middle">
		<A class=subMenuLink href="javascript:queryAdv1.action='<c:url value="/modules/plan/plan.do?method=list&t=4"/>';queryAdv1.submit();">${menu_plan_label1}</A></TH>
	<th width="48" align="right" class="menu_title_right"></th>
	</TR>
 </TBODY>
</TABLE>
<TABLE class=subMenu cellSpacing=0 cellPadding=0 width="100%" border=0>
	<tr>
	<c:forEach items="${underUsers}" end="5" var="user" varStatus="status">
	 <c:if test="${status.index<6}">
		<TD noWrap align="left" width="50%">
			<A class=subMenuLink onclick="javascript:queryAdv1.action='<c:url value="/modules/plan/plan.do?method=getLatestPlan&id=${user.id}&t=4"/>';queryAdv1.submit();">
    		<IMG src="../../themes/${sessionScope.loginUser.theme}/images/mplan.gif" align="absmiddle"></A>
    		<A class=subMenuLink style="color:${param.userid==user.id?'red':''}" href="javascript:queryAdv1.action='<c:url value="/modules/plan/plan.do?method=query&search_userXXid_i_eq=${user.id}&t=4"/>';queryAdv1.submit();">${user.name}</A>
     	</TD>
     </c:if>
     <c:if test="${(status.index+1)%2==0}"></tr><tr></c:if>
    </c:forEach>
	</tr>
	<tr style="display:${fn:length(underUsers)>6?'':'none'}"><td colspan="2" align="right">
		   		  <DIV align=right><SPAN id=show_icon
				  style="DISPLAY:${cookie.show_allUnder.value==null?'inline':(cookie.show_allUnder.value=='inline'?'none':'inline')}"><A class=utilsLink 
				  onclick="showSubPanel('show_allUnder');document.getElementById('show_icon').style.display='none';document.getElementById('hide_icon').style.display='';return false;" 
				  href="#"><IMG 
				  height="8" alt="${footer_message_5}" 
				  src="../../themes/${sessionScope.loginUser.theme}/skin/${sessionScope.loginUser.themePath}/images/advanced_search.gif" 
				  width="8" border="0"></A></SPAN><SPAN id=hide_icon
				  style="DISPLAY:${cookie.show_allUnder.value==null?'none':(cookie.show_allUnder.value=='inline'?'inline':'none')}"><A class=utilsLink 
				  onclick="hideSubPanel('show_allUnder');document.getElementById('hide_icon').style.display='none';document.getElementById('show_icon').style.display='';return false;" 
				  href="#"><IMG 
				  height="8"
				  src="../../themes/${sessionScope.loginUser.theme}/skin/${sessionScope.loginUser.themePath}/images/basic_search.gif" 
				  width="8" border="0"></A></SPAN></DIV>
		   	   </td></tr>
	
    <TBODY id="show_allUnder" style="display:${cookie.show_allUnder.value==null?'none':(cookie.show_allUnder.value=='none'?'none':'inline')}">
	  <tr>
		<c:forEach items="${underUsers}" begin="6" var="user" varStatus="status">
			<TD noWrap align="left" width="50%">
			<A class=subMenuLink onclick="javascript:queryAdv1.action='<c:url value="/modules/plan/plan.do?method=getLatestPlan&id=${user.id}&t=4"/>';queryAdv1.submit();">
	    		<IMG src="../../themes/${sessionScope.loginUser.theme}/images/mplan.gif" align="absmiddle"></A>
	    		<A class=subMenuLink style="color:${param.userid==user.id?'red':''}" href="javascript:queryAdv1.action='<c:url value="/modules/plan/plan.do?method=query&search_userXXid_i_eq=${user.id}&t=4"/>';queryAdv1.submit();">${user.name}</A>
	     	</TD>
	     	<c:if test="${(status.index+1)%2==0}"></tr><tr></c:if>
	    </c:forEach>
		</tr>
	 </TBODY>
</TABLE>
</c:if>

<br/>
<form name="attentionuser" action="<c:url value="/modules/plan/plan.do?method=ajaxSaveAttentionuser"/>" method="post">
<c:set var="attuserNames" value=""/>
<c:set var="attuserIds" value=""/>
<c:forEach items="${attentionUsers}" var="auser">
	<c:set var="attuserNames" value="${attuserNames},${auser.attentionUser.name}"/>
	<c:set var="attuserIds" value="${attuserIds},${auser.attentionUser.id}"/>
</c:forEach>

	<input type="hidden" name="attuserids" value="${attuserIds}" />
	<input type="hidden" name="attusernames" value="${attuserNames}" />
<TABLE class=leftColumnModuleHead cellSpacing=0 cellPadding=0 width="100%" border=0 valign="top">
 <TBODY>
  <TR>
    <TH class="menu_title_left" width=48>&nbsp;</TH>
    <TH class="menu_title_middle">
		<A class=subMenuLink href="javascript:queryAdv1.action='<c:url value="/modules/plan/plan.do?method=list&t=5"/>';queryAdv1.submit();">${menu_plan_label2}</A> 
	<A class=subMenuLink href="javascript:openwindow('<c:url value="/modules/security/userTree.do?method=list&openwin=true&op=1&selected=999&formName=attentionuser"/>'+'&supname=attusernames&superior=attuserids&supervalue='+$('attuserids').value);"><font color="#CC0016">${menu_plan_label3}</font></A></TH>
	<th width="48" align="right" class="menu_title_right"></th>
	</TR>
 </TBODY>
</TABLE>
</form>

<TABLE class=subMenu cellSpacing=0 cellPadding=0 width="100%" border=0>
	<tbody id="show_attentionUnder_top">
	<tr>
	<c:forEach items="${attentionUsers}" end="5" var="user" varStatus="status">
	 <c:if test="${status.index<6}">
		<TD  noWrap align="left" width="50%">
		<A class=subMenuLink onclick="javascript:queryAdv1.action='<c:url value="/modules/plan/plan.do?method=getLatestPlan&id=${user.attentionUser.id}&t=5"/>';queryAdv1.submit();">
    		<IMG src="../../themes/${sessionScope.loginUser.theme}/images/mplan.gif" align="absmiddle"></A>
    		<A class=subMenuLink style="color:${param.userid==user.id?'red':''}" href="javascript:queryAdv1.action='<c:url value="/modules/plan/plan.do?method=query&search_userXXid_i_eq=${user.attentionUser.id}&t=5"/>';queryAdv1.submit();">${user.attentionUser.name}</A>
     	</TD>
     </c:if>
     <c:if test="${(status.index+1)%2==0}"></tr><tr></c:if>
    </c:forEach>
	</tr>
	</tbody>
	<tr id="show_attentionUnder_icon" style="display:${fn:length(attentionUsers)>6?'':'none'}"><td colspan="2" align="right">
		   		  <DIV align=right><SPAN id=show_icon1 
				  style="DISPLAY:${cookie.show_attentionUnder.value==null?'inline':(cookie.show_attentionUnder.value=='inline'?'none':'inline')}"><A class=utilsLink 
				  onclick="showSubPanel('show_attentionUnder');document.getElementById('show_icon1').style.display='none';document.getElementById('hide_icon1').style.display='';return false;" 
				  href="#"><IMG 
				  height="8" alt="${footer_message_5}" 
				  src="../../themes/${sessionScope.loginUser.theme}/skin/${sessionScope.loginUser.themePath}/images/advanced_search.gif" 
				  width="8" border="0"></A></SPAN><SPAN id=hide_icon1 
				  style="DISPLAY:${cookie.show_attentionUnder.value==null?'none':(cookie.show_attentionUnder.value=='inline'?'inline':'none')}}"><A class=utilsLink 
				  onclick="hideSubPanel('show_attentionUnder');document.getElementById('hide_icon1').style.display='none';document.getElementById('show_icon1').style.display='';return false;" 
				  href="#"><IMG 
				  height="8"
				  src="../../themes/${sessionScope.loginUser.theme}/skin/${sessionScope.loginUser.themePath}/images/basic_search.gif" 
				  width="8" border="0"></A></SPAN></DIV>
		   	   </td></tr>
    <TBODY id="show_attentionUnder" style="display: ${cookie.show_attentionUnder.value==null?'none':(cookie.show_attentionUnder.value=='none'?'none':'inline')}">
	  <tr>
		<c:forEach items="${attentionUsers}" begin="6" var="user" varStatus="status">
			<TD noWrap align="left" width="50%">
			<A class=subMenuLink onclick="javascript:queryAdv1.action='<c:url value="/modules/plan/plan.do?method=getLatestPlan&id=${user.attentionUser.id}&t=5"/>';queryAdv1.submit();">
	    		<IMG src="../../themes/${sessionScope.loginUser.theme}/images/mplan.gif" align="absmiddle"></A>
	    		<A class=subMenuLink style="color:${param.userid==user.attentionUser.id?'red':''}" href="javascript:queryAdv1.action='<c:url value="/modules/plan/plan.do?method=query&search_userXXid_i_eq=${user.attentionUser.id}&t=5"/>';queryAdv1.submit();">${user.attentionUser.name}</A>
	     	</TD>
	     	<c:if test="${(status.index+1)%2==0}"></tr><tr></c:if>
	    </c:forEach>
		</tr>
	 </TBODY>
</TABLE>


<br/>
<TABLE class=leftColumnModuleHead cellSpacing=0 cellPadding=0 width="100%" border=0 valign="top">
 <TBODY>
  <TR>
    <TH class="menu_title_left" width=48>&nbsp;</TH>
	<TH class="menu_title_middle">
		<A class=subMenuLink href="javascript:queryAdv1.action='<c:url value="/modules/plan/plan.do?method=list&t=3"/>';queryAdv1.submit();">${menu_plan_label4}</A></TH>
	<th width="48" align="right" class="menu_title_right"></th>
  </TR>
 </TBODY>
</TABLE>
<TABLE class=subMenu cellSpacing=0 cellPadding=0 width="100%" border=0>
	  <TBODY>	
	  <c:forEach var="plan" items="${plans}">
	<TR>
	  <TD class=subMenuTD noWrap>
	  <A  class=subMenuLink href="javascript:queryAdv1.action='<c:url value="/modules/plan/plan.do?method=edit&id=${plan.id}&t=${t}"/>';queryAdv1.submit();">
        
        	 ${plan.year}${plan_docex_label3}

        	<c:if test="${plan.planType==1}">${plan_docex_label4} ${plan.currNo} ${plan_docex_label5}</c:if>
        	<c:if test="${plan.planType==2}">${plan_docex_label4} ${plan.currNo} ${plan_docex_label6}</c:if>
        	<c:if test="${plan.planType==3}">${plan_docex_label4} ${plan.currNo} ${plan_docex_label7}</c:if>
        	<c:if test="${plan.planType==4}">${(plan.currNo==1)?plan_docex_label8:plan_docex_label9}</c:if>
        	<c:if test="${plan.planType==5}">${plan_docex_label10}</c:if>
        	${plan_docex_label11}</A>
	  </TD>
    </TR>
    </c:forEach>
	  </TBODY>
</TABLE>